<template>
  <el-row :gutter="40" class="panel-group">
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('newVisitis')">
        <canvas-box :data="totalInfo.dayContractMoney" :fill-style="'#F58E44'" :describe="'日'" />
        <div class="card-panel-description" />
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('messages')">
        <canvas-box :data="totalInfo.weekContractMoney" :name="'week'" :describe="'周'" />
        <div class="card-panel-description" />
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('purchases')">
        <canvas-box :data="totalInfo.monthContractMoney" :name="'month'" :describe="'月'" />
        <div class="card-panel-description" />
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('shoppings')">
        <canvas-box :data="totalInfo.yearContractMoney" :name="'year'" :describe="'年'" />
        <div class="card-panel-description" />
      </div>
    </el-col>
  </el-row>
</template>

<script>
import canvasBox from './canvasBox';
export default {
  components: {
    canvasBox
  },
  props: {
  },
  data() {
    return {
      totalInfo: {}
    };
  },
  mounted() {
  },
  methods: {
    handleSetLineChartData(type) {
      this.$emit('handleSetLineChartData', type);
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.panel-group {
  margin-top: 18px;
  .card-panel-col{
    // margin-bottom: 32px;
  }
  .card-panel {
    height: 74px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    // box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);
    // &:hover {
    //   .card-panel-icon-wrapper {
    //     color: #fff;
    //   }
    //   .icon-people {
    //      background: #40c9c6;
    //   }
    //   .icon-message {
    //     background: #36a3f7;
    //   }
    //   .icon-money {
    //     background: #f4516c;
    //   }
    //   .icon-shopping {
    //     background: #34bfa3
    //   }
    // }
    .icon-people {
      color: #40c9c6;
    }
    .icon-message {
      color: #36a3f7;
    }
    .icon-money {
      color: #f4516c;
    }
    .icon-shopping {
      color: #34bfa3
    }
    .card-panel-icon-wrapper {
      position: relative;
      float: left;
      transition: all 0.38s ease-out;
      border-radius: 6px;
      .prices{
        width: 212px;
        height: 80px;
        background: linear-gradient(90deg, #F5B844 0%, #14142B 100%);
        opacity: 0.36;
        position: absolute;
        left: 40px;
      }
      canvas{
        position: absolute;
        z-index: 1;
      }
    }
    .card-panel-icon {
      float: left;
      font-size: 48px;
    }
    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;
      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }
      .card-panel-num {
        font-size: 20px;
      }
    }
  }
}
</style>
